<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/12/27 0027
 * Time: 14:43
 */

use yii\helpers\Html;
use yii\grid\GridView;
use backend\controllers\DtActionFilter;

$step10 = false;
if ($investigation->conclusion != '')
    $step10 = true;

?>

<div class="summary  top10" id="zongJie">
    <div class="container containerShadow">
        <div class="row">
            <div class="topimg">
                <div class="left pull-left">
                    <span>尽调评估总结
                        <strong class="step10_nothing" style="color: #4da1ff;font-size: 14px;"><?php if(!$step10) echo '（暂无数据）'; ?></strong>
                    </span>
                </div>
                <div class="pull-right">
                    <a href="###">
                        <?php
                        //if (DtActionFilter::checkProject('project_edit', $model->id))
                        if (DtActionFilter::checkProject('project_edit', $projectId))
                            echo Html::img('@web/image/projectDetails/edit.png', ['class' => 'editImg']);
                        ?>
                    </a>
                </div>
            </div>
            <form action="" style="display: <?php if(!$step10) echo 'none'; else echo 'block';?>;">
                <div class="summaryText">
                	 <p class="">结论</p>
                    <pre name="ProjectInvestigation['conclusion']" class="conclusion" style="padding: 14px!important;"><?php if($investigation->conclusion=='') {?><?php   } else {echo Html::encode($investigation->conclusion);}?></pre>
                <!--    <textarea name="ProjectInvestigation['conclusion']" rows="" cols="" readonly="readonly" class="conclusion" style="width: 100%; padding: 0 14px!important; "><?php if($investigation->conclusion=='') {?><?php   } else {echo Html::encode($investigation->conclusion);}?></textarea>-->
                </div>
            </form>
            <form action="" name="investigation_summarize" method="" style="display: none;">
            	 <p class="summarize">结论</p>
                <div class="summaryText summarizeText">
                  <!--  <p>结论</p>-->
                    <textarea style="min-height: 34px;" name="ProjectInvestigation[conclusion]" class="textarea-edit2 textG"><?php echo Html::encode($investigation->conclusion); ?></textarea>
                </div>
                <div class="cancelInConfirm clearfix">
                    <input class="cancelInConfirmActive investigation_summarize_confirm" type="button" value="保存"/>
                    <input class="investigation_summarize_cancel" type="button" value="取消"/>
                    <input type="hidden" name="id" value="<?php echo $investigation->id; ?>"/>
                    <input type="hidden" name="ProjectInvestigation[project_id]" value="<?php echo $projectId; ?>"/>
                    <input type="hidden" class="step10_state" value="<?php if($step10) echo 1; else echo 2;?>"/>
                </div>
            </form>
        </div>
    </div>
</div>


 <!-- textarea 高度设置对比div -->
	
<div style="max-height: 1px; overflow: hidden;">
	
	<div id="d2" style="visibility: hidden; min-height: 34px;"></div>

</div>


<script type="text/javascript">
	// textarea 高度展示问题
			//编辑页面texate高度设置开始
             $(".textarea-edit2").focus(function(){
				  var val = $(this).val();
				   $("#d2").width($(this).width())
				  $("#d2").html("<pre>" +val+" "+"</pre>");
				  var h = $("#d2").height() ;
				  $(this).height(h);
		     })
		     $(".textarea-edit2").keyup(function(){
			      var val = $(this).val();
				   $("#d2").width($(this).width());
				  $("#d2").html("<pre>" +val+" "+"</pre>");
				  var h = $("#d2").height();
				  console.log(h);
				  $(this).height(h);
		     })
             // 编辑页面texate高度设置结束
//                  高亮显示开始    
				$(document).on('focus','.textG',function(){
			 		$(".summaryText").css({
						'border':'1px solid #2194f1'
					})
			 	})
			 	$(document).on('blur','.textG',function(){
			 		$(".summaryText").css({
						'border':'1px solid #e2e2e2'
					})
			 	})
//                 	 高亮显示结束    
    
</script>
